<!-- HTML header for doxygen 1.8.8-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <!-- For Mobile Devices -->
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
        <meta name="generator" content="Doxygen 1.8.18"/>
        <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
        <title>HElib: /HElib/include/helib/Ptxt.h Source File</title>
        <!--<link href="tabs.css" rel="stylesheet" type="text/css"/>-->
        <script type="text/javascript" src="dynsections.js"></script>
        <link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
        <link href='https://fonts.googleapis.com/css?family=Roboto+Slab' rel='stylesheet' type='text/css'>
		<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100;1,700&family=Merriweather&family=Merriweather+Sans&family=Open+Sans&family=Poppins:ital@1&family=Roboto:ital,wght@0,400;1,300;1,900&display=swap" rel="stylesheet"> 
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
        <link href="jquery.smartmenus.bootstrap.css" rel="stylesheet">
        <script type="text/javascript" src="jquery.smartmenus.js"></script>
        <!-- SmartMenus jQuery Bootstrap Addon -->
        <script type="text/javascript" src="jquery.smartmenus.bootstrap.js"></script>
        <!-- SmartMenus jQuery plugin -->
    </head>
    <body style="font-family: 'Merriweather', serif;">
        <nav class="navbar navbar-default" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand">HElib Implementing Homomorphic Encryption</a>
                </div>
            </div>
        </nav>
        <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
            <div class="content" id="content">
                <div class="container">
                    <div class="row">
                        <div class="col-sm-12 panel " style="padding-bottom: 15px;">
                            <div style="margin-bottom: 15px;">
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_d0c4ae63660968bf6b1c77a1e8aecf95.html">helib</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Ptxt.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_ptxt_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/* Copyright (C) 2019-2020 IBM Corp.</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * This program is Licensed under the Apache License, Version 2.0</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * (the &quot;License&quot;); you may not use this file except in compliance</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * with the License. You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *   http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * limitations under the License. See accompanying LICENSE file.</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160; </div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#ifndef HELIB_PTXT_H</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#define HELIB_PTXT_H</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160; </div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &lt;type_traits&gt;</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#include &lt;algorithm&gt;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &lt;numeric&gt;</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &lt;iomanip&gt;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160; </div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="_context_8h.html">helib/Context.h</a>&gt;</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="_encrypted_array_8h.html">helib/EncryptedArray.h</a>&gt;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="assertions_8h.html">helib/assertions.h</a>&gt;</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="_poly_mod_8h.html">helib/PolyMod.h</a>&gt;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160; </div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacehelib.html">helib</a> {</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160; </div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="structhelib_1_1_c_k_k_s.html">   38</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structhelib_1_1_c_k_k_s.html">CKKS</a></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;{</div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="structhelib_1_1_c_k_k_s.html#a7c8b6e96117c89f9395b2f1ccdc1e0a0">   43</a></span>&#160;  <span class="keyword">using</span> <a class="code" href="structhelib_1_1_c_k_k_s.html#a7c8b6e96117c89f9395b2f1ccdc1e0a0">SlotType</a> = std::complex&lt;double&gt;;</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;};</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160; </div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="structhelib_1_1_b_g_v.html">   49</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structhelib_1_1_b_g_v.html">BGV</a></div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;{</div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="structhelib_1_1_b_g_v.html#a09c79ac9a958d2d2b93c34d89c3ca65b">   55</a></span>&#160;  <span class="keyword">using</span> <a class="code" href="classhelib_1_1_poly_mod.html">SlotType</a> = <a class="code" href="classhelib_1_1_poly_mod.html">PolyMod</a>;</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;};</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160; </div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="comment">// Utility functions</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160; </div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> From, <span class="keyword">typename</span> Scheme&gt;</div>
<div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="namespacehelib.html#ae05ae4d1e5789165fa5fe70824e87077">   69</a></span>&#160;<span class="keyword">inline</span> std::vector&lt;typename Scheme::SlotType&gt; <a class="code" href="namespacehelib.html#ae05ae4d1e5789165fa5fe70824e87077">convertDataToSlotVector</a>(</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <span class="keyword">const</span> std::vector&lt;From&gt;&amp; data,</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a>&amp; context)</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;{</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;  static_assert(std::is_same&lt;Scheme, CKKS&gt;::value ||</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;                    std::is_same&lt;Scheme, BGV&gt;::value,</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;                <span class="stringliteral">&quot;Can only call convertDataToSlotVector with Scheme equals to &quot;</span></div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;                <span class="stringliteral">&quot;CKKS or BGV&quot;</span>);</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;  <span class="keyword">using</span> To = <span class="keyword">typename</span> Scheme::SlotType;</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;  std::vector&lt;To&gt; res(data.size(), <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;::convertToSlot</a>(context, 0l));</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;  <span class="keywordflow">for</span> (std::size_t i = 0; i &lt; data.size(); ++i) {</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    res[i] = data[i];</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;  }</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;  <span class="keywordflow">return</span> res;</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;}</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160; </div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> Scheme&gt;</div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="namespacehelib.html#a98d0e8b458fb8f75fa79ff7c7effe58e">   95</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespacehelib.html#a391719dad458fcb9560406cb565f8cbe">innerProduct</a>(<a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; result,</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;                  <span class="keyword">const</span> std::vector&lt;<a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&gt;&amp; first_vec,</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;                  <span class="keyword">const</span> std::vector&lt;<a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&gt;&amp; second_vec)</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;{</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;  static_assert(std::is_same&lt;Scheme, CKKS&gt;::value ||</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;                    std::is_same&lt;Scheme, BGV&gt;::value,</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;                <span class="stringliteral">&quot;Can only call innerProduct with Scheme equals to CKKS or BGV&quot;</span>);</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;  <span class="keywordflow">for</span> (std::size_t i = 0; i &lt; first_vec.size(); ++i) {</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    assertTrue&lt;RuntimeError&gt;(first_vec[i].isValid(),</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;                             <span class="stringliteral">&quot;Cannot call innerProduct on default-constructed&quot;</span></div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;                             <span class="stringliteral">&quot; Ptxt as first argument at index &quot;</span> +</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;                                 std::to_string(i));</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;  }</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;  <span class="keywordflow">for</span> (std::size_t i = 0; i &lt; second_vec.size(); ++i) {</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    assertTrue&lt;RuntimeError&gt;(second_vec[i].isValid(),</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;                             <span class="stringliteral">&quot;Cannot call innerProduct on default-constructed&quot;</span></div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;                             <span class="stringliteral">&quot; Ptxt as second argument at index &quot;</span> +</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;                                 std::to_string(i));</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;  }</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;  <span class="keywordtype">long</span> n = std::min(first_vec.size(), second_vec.size());</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;  <span class="keywordflow">if</span> (n &lt;= 0) {</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    result.<a class="code" href="classhelib_1_1_ptxt.html#a47b64faee8b052ccccda7df6a5fa0a22">clear</a>();</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;  }</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;  result = first_vec[0];</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;  result *= second_vec[0];</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;  <span class="keywordflow">for</span> (<span class="keywordtype">long</span> i = 1; i &lt; n; ++i)</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    result += (first_vec[i] * second_vec[i]);</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;}</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160; </div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> Scheme&gt;</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;<span class="keyword">class </span>Ptxt</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;{</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;  static_assert(std::is_same&lt;Scheme, CKKS&gt;::value ||</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;                    std::is_same&lt;Scheme, BGV&gt;::value,</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;                <span class="stringliteral">&quot;Can only create plaintext object parameterized by the crypto &quot;</span></div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;                <span class="stringliteral">&quot;scheme (CKKS or BGV)&quot;</span>);</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160; </div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00176"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a208b1ed55bce96f126191cb7a39b92e7">  176</a></span>&#160;  <span class="keyword">using</span> <a class="code" href="classhelib_1_1_ptxt.html#a208b1ed55bce96f126191cb7a39b92e7">SlotType</a> = <span class="keyword">typename</span> Scheme::SlotType;</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160; </div>
<div class="line"><a name="l00182"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#ab38174daa0112a946ccbd93b599b3a4f">  182</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html#ab38174daa0112a946ccbd93b599b3a4f">Ptxt</a>();</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160; </div>
<div class="line"><a name="l00188"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#ac34ee5c8a8c3341cd97b57345aee7f84">  188</a></span>&#160;  <span class="keyword">explicit</span> <a class="code" href="classhelib_1_1_ptxt.html#ac34ee5c8a8c3341cd97b57345aee7f84">Ptxt</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a>&amp; context);</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160; </div>
<div class="line"><a name="l00195"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a063d478ac57438d9434921967313f474">  195</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html#a063d478ac57438d9434921967313f474">Ptxt</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a>&amp; context, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_ptxt.html#a208b1ed55bce96f126191cb7a39b92e7">SlotType</a>&amp; value);</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160; </div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> U = Scheme,</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;            std::enable_if_t&lt;std::is_same&lt;U, BGV&gt;::value&gt;* = <span class="keyword">nullptr</span>&gt;</div>
<div class="line"><a name="l00206"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#af5550960308d217de80a149432acb6aa">  206</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html#af5550960308d217de80a149432acb6aa">Ptxt</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a>&amp; context, <span class="keyword">const</span> NTL::ZZX&amp; value);</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160; </div>
<div class="line"><a name="l00213"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#acba1c7e7d92aa7a31b555046fa39f4b3">  213</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html#acba1c7e7d92aa7a31b555046fa39f4b3">Ptxt</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a>&amp; context, <span class="keyword">const</span> std::vector&lt;SlotType&gt;&amp; data);</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160; </div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a name="l00221"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#af7b37d52345b0cfab052227e43278f28">  221</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html#af7b37d52345b0cfab052227e43278f28">Ptxt</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a>&amp; context, <span class="keyword">const</span> std::vector&lt;T&gt;&amp; data) :</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;      <a class="code" href="classhelib_1_1_ptxt.html">Ptxt</a>&lt;Scheme&gt;(context, <a class="code" href="namespacehelib.html#ae05ae4d1e5789165fa5fe70824e87077">convertDataToSlotVector</a>&lt;T, Scheme&gt;(data, context))</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;  {}</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160; </div>
<div class="line"><a name="l00229"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a2f4c6a71ce9e9976e72a77f6c3175114">  229</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html#a2f4c6a71ce9e9976e72a77f6c3175114">Ptxt</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; other) = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160; </div>
<div class="line"><a name="l00235"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#ac4568bc2e02b7dc906568f2c7c7eaaa8">  235</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html#ac4568bc2e02b7dc906568f2c7c7eaaa8">Ptxt</a>(<a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp;&amp; other) noexcept = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160; </div>
<div class="line"><a name="l00241"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#af20f43e81e6e83711e6a2f877c5d976e">  241</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#af20f43e81e6e83711e6a2f877c5d976e">operator=</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; v) = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160; </div>
<div class="line"><a name="l00247"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a2e4cb8d393da906329f6a591d399a346">  247</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a2e4cb8d393da906329f6a591d399a346">operator=</a>(<a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp;&amp; v) noexcept = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160; </div>
<div class="line"><a name="l00252"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a71edaa17612629ec56220ea022202016">  252</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html#a71edaa17612629ec56220ea022202016">~Ptxt</a>() = <span class="keywordflow">default</span>;</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160; </div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classhelib_1_1_ptxt.html#adc3c98383082db58d8980e4d4ad5aa49">isValid</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160; </div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;  <span class="keywordtype">size_t</span> <a class="code" href="classhelib_1_1_ptxt.html#a892c7c40f3029f29b4ed0bbd633301d8">size</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160; </div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;  <span class="keywordtype">long</span> <a class="code" href="classhelib_1_1_ptxt.html#a39d6d5db3059090134312fecefc468da">lsize</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160; </div>
<div class="line"><a name="l00276"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a1ac29a900263dbba14e9a48e651b9159">  276</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_ptxt.html#a1ac29a900263dbba14e9a48e651b9159">setData</a>(<span class="keyword">const</span> std::vector&lt;SlotType&gt;&amp; data);</div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160; </div>
<div class="line"><a name="l00282"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a1ff66432c893d5af08e11151d532ab6c">  282</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_ptxt.html#a1ff66432c893d5af08e11151d532ab6c">setData</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_ptxt.html#a208b1ed55bce96f126191cb7a39b92e7">SlotType</a>&amp; value);</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160; </div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T = Scheme,</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;            <span class="keyword">typename</span> std::enable_if_t&lt;std::is_same&lt;T, BGV&gt;::value&gt;* = <span class="keyword">nullptr</span>&gt;</div>
<div class="line"><a name="l00291"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a84591d6e8b595b82e67e5f5968638228">  291</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_ptxt.html#a84591d6e8b595b82e67e5f5968638228">setData</a>(<span class="keyword">const</span> NTL::ZZX&amp; value);</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160; </div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T = Scheme,</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;            <span class="keyword">typename</span> std::enable_if_t&lt;std::is_same&lt;T, BGV&gt;::value&gt;* = <span class="keyword">nullptr</span>&gt;</div>
<div class="line"><a name="l00301"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a6089a4133bf1b54676a70ea49e89d20e">  301</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_ptxt.html#a6089a4133bf1b54676a70ea49e89d20e">decodeSetData</a>(<span class="keyword">const</span> NTL::ZZX&amp; data);</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160; </div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classhelib_1_1_ptxt.html#a47b64faee8b052ccccda7df6a5fa0a22">clear</a>();</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160; </div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a8e771f1be21da0f50d6df0a2a541e568">random</a>();</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160; </div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;  <span class="keyword">const</span> std::vector&lt;SlotType&gt;&amp; <a class="code" href="classhelib_1_1_ptxt.html#a9079d2c55de7a19af137da3d042c50d4">getSlotRepr</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160; </div>
<div class="line"><a name="l00326"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a2856a44b1a4ed056b2ab25136572dc16">  326</a></span>&#160;  NTL::ZZX <a class="code" href="classhelib_1_1_ptxt.html#a2856a44b1a4ed056b2ab25136572dc16">getPolyRepr</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160; </div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html#a208b1ed55bce96f126191cb7a39b92e7">SlotType</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a237db676327d7353bee8852cd3a9416c">operator[]</a>(<span class="keywordtype">long</span> i);</div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160; </div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html#a208b1ed55bce96f126191cb7a39b92e7">SlotType</a> <a class="code" href="classhelib_1_1_ptxt.html#a237db676327d7353bee8852cd3a9416c">operator[]</a>(<span class="keywordtype">long</span> i) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160; </div>
<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html#a208b1ed55bce96f126191cb7a39b92e7">SlotType</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a111b70a6cf4517c55c3f5337308903a4">at</a>(<span class="keywordtype">long</span> i);</div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160; </div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html#a208b1ed55bce96f126191cb7a39b92e7">SlotType</a> <a class="code" href="classhelib_1_1_ptxt.html#a111b70a6cf4517c55c3f5337308903a4">at</a>(<span class="keywordtype">long</span> i) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160; </div>
<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classhelib_1_1_ptxt.html#a2bb2dbd5b558778d17658182ee05d4a8">operator==</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; other) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160; </div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;  <span class="keywordtype">bool</span> <a class="code" href="classhelib_1_1_ptxt.html#a7e6d01d3c64034b36c49744714fc1721">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; other) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160; </div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a> <a class="code" href="classhelib_1_1_ptxt.html#ad0d1e152b220e9219e015d8601972efe">operator*</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; rhs) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160; </div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a> <a class="code" href="classhelib_1_1_ptxt.html#ab4c4b82672819e72a5eab6883cf54cae">operator+</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; rhs) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160; </div>
<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a> <a class="code" href="classhelib_1_1_ptxt.html#adfe4b6cb41fcdabb88f2e6533c1829e2">operator-</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; rhs) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160; </div>
<div class="line"><a name="l00398"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#af174eb635bae2953ad834594167972f4">  398</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#af174eb635bae2953ad834594167972f4">operator*=</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; otherPtxt);</div>
<div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160; </div>
<div class="line"><a name="l00405"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#af6f617ad696129bf2f1c97f082875417">  405</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#af6f617ad696129bf2f1c97f082875417">operator*=</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_ptxt.html#a208b1ed55bce96f126191cb7a39b92e7">SlotType</a>&amp; scalar);</div>
<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160; </div>
<div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Scalar&gt;</div>
<div class="line"><a name="l00413"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a56bda6e45a7f413914cea175a4edcca6">  413</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a56bda6e45a7f413914cea175a4edcca6">operator*=</a>(<span class="keyword">const</span> Scalar&amp; scalar)</div>
<div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;  {</div>
<div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;    assertTrue&lt;RuntimeError&gt;(<a class="code" href="classhelib_1_1_ptxt.html#adc3c98383082db58d8980e4d4ad5aa49">isValid</a>(),</div>
<div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;                             <span class="stringliteral">&quot;Cannot call operator*= on &quot;</span></div>
<div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;                             <span class="stringliteral">&quot;default-constructed Ptxt&quot;</span>);</div>
<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;    <span class="keywordflow">for</span> (std::size_t i = 0; i &lt; this-&gt;slots.size(); i++) {</div>
<div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;      this-&gt;slots[i] *= scalar;</div>
<div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;    }</div>
<div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;    <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;  }</div>
<div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160; </div>
<div class="line"><a name="l00429"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a2962844c9a07023f7de74bf954d6cc1d">  429</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a2962844c9a07023f7de74bf954d6cc1d">operator+=</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; otherPtxt);</div>
<div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160; </div>
<div class="line"><a name="l00436"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#ac5b145f55caed90aca67b22a5abda9b7">  436</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#ac5b145f55caed90aca67b22a5abda9b7">operator+=</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_ptxt.html#a208b1ed55bce96f126191cb7a39b92e7">SlotType</a>&amp; scalar);</div>
<div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160; </div>
<div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Scalar&gt;</div>
<div class="line"><a name="l00444"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#ab1db75c37d202538affad4865f6d60b0">  444</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#ab1db75c37d202538affad4865f6d60b0">operator+=</a>(<span class="keyword">const</span> Scalar&amp; scalar)</div>
<div class="line"><a name="l00445"></a><span class="lineno">  445</span>&#160;  {</div>
<div class="line"><a name="l00446"></a><span class="lineno">  446</span>&#160;    assertTrue&lt;RuntimeError&gt;(<a class="code" href="classhelib_1_1_ptxt.html#adc3c98383082db58d8980e4d4ad5aa49">isValid</a>(),</div>
<div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;                             <span class="stringliteral">&quot;Cannot call operator+= on &quot;</span></div>
<div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160;                             <span class="stringliteral">&quot;default-constructed Ptxt&quot;</span>);</div>
<div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;    <span class="keywordflow">for</span> (std::size_t i = 0; i &lt; this-&gt;slots.size(); i++) {</div>
<div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;      this-&gt;slots[i] += scalar;</div>
<div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;    }</div>
<div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;    <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;  }</div>
<div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160; </div>
<div class="line"><a name="l00460"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#ab3f4f86d8be5982f163edda7b69e05a6">  460</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#ab3f4f86d8be5982f163edda7b69e05a6">operator-=</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; otherPtxt);</div>
<div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160; </div>
<div class="line"><a name="l00467"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a0aea2308633c8fe6260b12a72278e83b">  467</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a0aea2308633c8fe6260b12a72278e83b">operator-=</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_ptxt.html#a208b1ed55bce96f126191cb7a39b92e7">SlotType</a>&amp; scalar);</div>
<div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160; </div>
<div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Scalar&gt;</div>
<div class="line"><a name="l00475"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#ac130b4ef05a3a3673b39f00ce31b2118">  475</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#ac130b4ef05a3a3673b39f00ce31b2118">operator-=</a>(<span class="keyword">const</span> Scalar&amp; scalar)</div>
<div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;  {</div>
<div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;    assertTrue&lt;RuntimeError&gt;(<a class="code" href="classhelib_1_1_ptxt.html#adc3c98383082db58d8980e4d4ad5aa49">isValid</a>(),</div>
<div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;                             <span class="stringliteral">&quot;Cannot call operator-= on &quot;</span></div>
<div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;                             <span class="stringliteral">&quot;default-constructed Ptxt&quot;</span>);</div>
<div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;    <span class="keywordflow">for</span> (std::size_t i = 0; i &lt; this-&gt;slots.size(); i++) {</div>
<div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;      this-&gt;slots[i] -= scalar;</div>
<div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;    }</div>
<div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;    <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div>
<div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;  }</div>
<div class="line"><a name="l00485"></a><span class="lineno">  485</span>&#160; </div>
<div class="line"><a name="l00490"></a><span class="lineno">  490</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#aa244b723b8202496b3916b8a16f6273c">negate</a>();</div>
<div class="line"><a name="l00491"></a><span class="lineno">  491</span>&#160; </div>
<div class="line"><a name="l00497"></a><span class="lineno">  497</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T = Scheme,</div>
<div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160;            <span class="keyword">typename</span> Scalar,</div>
<div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;            <span class="keyword">typename</span> std::enable_if_t&lt;std::is_same&lt;T, BGV&gt;::value&gt;* = <span class="keyword">nullptr</span>&gt;</div>
<div class="line"><a name="l00500"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a8468a37b7d0aad635d6a9236d426be21">  500</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a8468a37b7d0aad635d6a9236d426be21">addConstant</a>(<span class="keyword">const</span> Scalar&amp; scalar)</div>
<div class="line"><a name="l00501"></a><span class="lineno">  501</span>&#160;  {</div>
<div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;    <span class="keywordflow">return</span> *<span class="keyword">this</span> += scalar;</div>
<div class="line"><a name="l00503"></a><span class="lineno">  503</span>&#160;  }</div>
<div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160; </div>
<div class="line"><a name="l00510"></a><span class="lineno">  510</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T = Scheme,</div>
<div class="line"><a name="l00511"></a><span class="lineno">  511</span>&#160;            <span class="keyword">typename</span> Scalar,</div>
<div class="line"><a name="l00512"></a><span class="lineno">  512</span>&#160;            <span class="keyword">typename</span> std::enable_if_t&lt;std::is_same&lt;T, CKKS&gt;::value&gt;* = <span class="keyword">nullptr</span>&gt;</div>
<div class="line"><a name="l00513"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a19e06cbbfcb57ebafe71f650501f56cf">  513</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a19e06cbbfcb57ebafe71f650501f56cf">addConstantCKKS</a>(<span class="keyword">const</span> Scalar&amp; scalar)</div>
<div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;  {</div>
<div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160;    <span class="keywordflow">return</span> *<span class="keyword">this</span> += scalar;</div>
<div class="line"><a name="l00516"></a><span class="lineno">  516</span>&#160;  }</div>
<div class="line"><a name="l00517"></a><span class="lineno">  517</span>&#160; </div>
<div class="line"><a name="l00524"></a><span class="lineno">  524</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a5539f04b6f8741aa37f44700bb00ef63">multiplyBy</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; otherPtxt);</div>
<div class="line"><a name="l00525"></a><span class="lineno">  525</span>&#160; </div>
<div class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a33217b18b31a054fe1f1be6f3534c55a">multiplyBy2</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_ptxt.html">Ptxt</a>&amp; otherPtxt1, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_ptxt.html">Ptxt</a>&amp; otherPtxt2);</div>
<div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160; </div>
<div class="line"><a name="l00538"></a><span class="lineno">  538</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a594ce012fe4bf3ac5d45dc95609c7e4d">square</a>();</div>
<div class="line"><a name="l00539"></a><span class="lineno">  539</span>&#160; </div>
<div class="line"><a name="l00544"></a><span class="lineno">  544</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#af8c161f20f558486c92d71e65d8ec0e3">cube</a>();</div>
<div class="line"><a name="l00545"></a><span class="lineno">  545</span>&#160; </div>
<div class="line"><a name="l00552"></a><span class="lineno">  552</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#ad669299fa7fed4a37bc8536a9d3dcf05">power</a>(<span class="keywordtype">long</span> e);</div>
<div class="line"><a name="l00553"></a><span class="lineno">  553</span>&#160; </div>
<div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a9e87f1ffcfcd55fbfa04e0d8b68addb8">rotate</a>(<span class="keywordtype">long</span> amount);</div>
<div class="line"><a name="l00561"></a><span class="lineno">  561</span>&#160; </div>
<div class="line"><a name="l00568"></a><span class="lineno">  568</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#ae7933c3b8ff51f923a3bc95752a0fc2c">rotate1D</a>(<span class="keywordtype">long</span> dim, <span class="keywordtype">long</span> amount);</div>
<div class="line"><a name="l00569"></a><span class="lineno">  569</span>&#160; </div>
<div class="line"><a name="l00576"></a><span class="lineno">  576</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#afa812aae90f9454920a1033fc0790dfd">shift</a>(<span class="keywordtype">long</span> amount);</div>
<div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160; </div>
<div class="line"><a name="l00585"></a><span class="lineno">  585</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a73bfcf600de1d55cd66281428396a6ec">shift1D</a>(<span class="keywordtype">long</span> dim, <span class="keywordtype">long</span> amount);</div>
<div class="line"><a name="l00586"></a><span class="lineno">  586</span>&#160; </div>
<div class="line"><a name="l00593"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a794648794e265a250ad9c23572b92b39">  593</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a794648794e265a250ad9c23572b92b39">automorph</a>(<span class="keywordtype">long</span> k);</div>
<div class="line"><a name="l00594"></a><span class="lineno">  594</span>&#160; </div>
<div class="line"><a name="l00601"></a><span class="lineno">  601</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T = Scheme,</div>
<div class="line"><a name="l00602"></a><span class="lineno">  602</span>&#160;            std::enable_if_t&lt;std::is_same&lt;T, BGV&gt;::value&gt;* = <span class="keyword">nullptr</span>&gt;</div>
<div class="line"><a name="l00603"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a5d33b4eb138d5c12a50343d25ea3a993">  603</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a5d33b4eb138d5c12a50343d25ea3a993">frobeniusAutomorph</a>(<span class="keywordtype">long</span> j);</div>
<div class="line"><a name="l00604"></a><span class="lineno">  604</span>&#160; </div>
<div class="line"><a name="l00610"></a><span class="lineno">  610</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#ad1459a4416bb38e0863e220e5cfe6ff9">replicate</a>(<span class="keywordtype">long</span> pos);</div>
<div class="line"><a name="l00611"></a><span class="lineno">  611</span>&#160; </div>
<div class="line"><a name="l00619"></a><span class="lineno">  619</span>&#160;  std::vector&lt;Ptxt&lt;Scheme&gt;&gt; <a class="code" href="classhelib_1_1_ptxt.html#a7f5ad875da05a1562e319f3943892c67">replicateAll</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00620"></a><span class="lineno">  620</span>&#160; </div>
<div class="line"><a name="l00627"></a><span class="lineno">  627</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T = Scheme,</div>
<div class="line"><a name="l00628"></a><span class="lineno">  628</span>&#160;            std::enable_if_t&lt;std::is_same&lt;T, CKKS&gt;::value&gt;* = <span class="keyword">nullptr</span>&gt;</div>
<div class="line"><a name="l00629"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a200fd09c6efe0887037783e261946e8b">  629</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a200fd09c6efe0887037783e261946e8b">complexConj</a>();</div>
<div class="line"><a name="l00630"></a><span class="lineno">  630</span>&#160; </div>
<div class="line"><a name="l00636"></a><span class="lineno">  636</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T = Scheme,</div>
<div class="line"><a name="l00637"></a><span class="lineno">  637</span>&#160;            std::enable_if_t&lt;std::is_same&lt;T, CKKS&gt;::value&gt;* = <span class="keyword">nullptr</span>&gt;</div>
<div class="line"><a name="l00638"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#ae1a0c1d39f2077bede420a150d459e1d">  638</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a> <a class="code" href="classhelib_1_1_ptxt.html#ae1a0c1d39f2077bede420a150d459e1d">real</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00639"></a><span class="lineno">  639</span>&#160; </div>
<div class="line"><a name="l00645"></a><span class="lineno">  645</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T = Scheme,</div>
<div class="line"><a name="l00646"></a><span class="lineno">  646</span>&#160;            std::enable_if_t&lt;std::is_same&lt;T, CKKS&gt;::value&gt;* = <span class="keyword">nullptr</span>&gt;</div>
<div class="line"><a name="l00647"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#ace682ff41a5f1833ae298aa8d33e05d5">  647</a></span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a> <a class="code" href="classhelib_1_1_ptxt.html#ace682ff41a5f1833ae298aa8d33e05d5">imag</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00648"></a><span class="lineno">  648</span>&#160; </div>
<div class="line"><a name="l00654"></a><span class="lineno">  654</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a479e27b3f9a7550a750acf6613c33b8d">runningSums</a>();</div>
<div class="line"><a name="l00655"></a><span class="lineno">  655</span>&#160; </div>
<div class="line"><a name="l00661"></a><span class="lineno">  661</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a34fe386648aff89c3bf201d0f1ea1e5b">totalSums</a>();</div>
<div class="line"><a name="l00662"></a><span class="lineno">  662</span>&#160; </div>
<div class="line"><a name="l00668"></a><span class="lineno">  668</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#ad048de2d62d0e4c843ddb48b85c63314">incrementalProduct</a>();</div>
<div class="line"><a name="l00669"></a><span class="lineno">  669</span>&#160; </div>
<div class="line"><a name="l00675"></a><span class="lineno">  675</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a1587b07072208696849f02a3b40892e8">totalProduct</a>();</div>
<div class="line"><a name="l00676"></a><span class="lineno">  676</span>&#160; </div>
<div class="line"><a name="l00681"></a><span class="lineno">  681</span>&#160;  <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; <a class="code" href="classhelib_1_1_ptxt.html#a77c0d3dc8d65ad5c0abca52210878b9d">mapTo01</a>();</div>
<div class="line"><a name="l00682"></a><span class="lineno">  682</span>&#160; </div>
<div class="line"><a name="l00683"></a><span class="lineno">  683</span>&#160;  <span class="comment">// NOTE: Seem to get linker errors when moving this to the cpp</span></div>
<div class="line"><a name="l00696"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a11f7e4e965acab1f6db834797ae165f2">  696</a></span>&#160;<span class="comment"></span>  <span class="keyword">friend</span> std::istream&amp; <a class="code" href="classhelib_1_1_ptxt.html#a11f7e4e965acab1f6db834797ae165f2">operator&gt;&gt;</a>(std::istream&amp; is, <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; ptxt)</div>
<div class="line"><a name="l00697"></a><span class="lineno">  697</span>&#160;  {</div>
<div class="line"><a name="l00698"></a><span class="lineno">  698</span>&#160;    assertTrue&lt;RuntimeError&gt;(ptxt.isValid(),</div>
<div class="line"><a name="l00699"></a><span class="lineno">  699</span>&#160;                             <span class="stringliteral">&quot;Cannot operate on invalid &quot;</span></div>
<div class="line"><a name="l00700"></a><span class="lineno">  700</span>&#160;                             <span class="stringliteral">&quot;(default constructed) Ptxt&quot;</span>);</div>
<div class="line"><a name="l00701"></a><span class="lineno">  701</span>&#160;    <a class="code" href="namespacehelib.html#a0df3789de0744e7c90d5a5d6cf54a5ed">seekPastChar</a>(is, <span class="charliteral">&#39;[&#39;</span>);</div>
<div class="line"><a name="l00702"></a><span class="lineno">  702</span>&#160;    std::vector&lt;typename Scheme::SlotType&gt; data;</div>
<div class="line"><a name="l00703"></a><span class="lineno">  703</span>&#160;    <span class="keywordflow">for</span> (<span class="keyword">typename</span> Scheme::SlotType slot(</div>
<div class="line"><a name="l00704"></a><span class="lineno">  704</span>&#160;             <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;::convertToSlot</a>(*ptxt.context, 0L));</div>
<div class="line"><a name="l00705"></a><span class="lineno">  705</span>&#160;         is &gt;&gt; slot;</div>
<div class="line"><a name="l00706"></a><span class="lineno">  706</span>&#160;         data.push_back(slot))</div>
<div class="line"><a name="l00707"></a><span class="lineno">  707</span>&#160;      ; <span class="comment">// Do nothing.</span></div>
<div class="line"><a name="l00708"></a><span class="lineno">  708</span>&#160;    is.clear();</div>
<div class="line"><a name="l00709"></a><span class="lineno">  709</span>&#160;    <a class="code" href="namespacehelib.html#a0df3789de0744e7c90d5a5d6cf54a5ed">seekPastChar</a>(is, <span class="charliteral">&#39;]&#39;</span>);</div>
<div class="line"><a name="l00710"></a><span class="lineno">  710</span>&#160;    ptxt.setData(std::move(data));</div>
<div class="line"><a name="l00711"></a><span class="lineno">  711</span>&#160;    <span class="keywordflow">return</span> is;</div>
<div class="line"><a name="l00712"></a><span class="lineno">  712</span>&#160;  }</div>
<div class="line"><a name="l00713"></a><span class="lineno">  713</span>&#160; </div>
<div class="line"><a name="l00714"></a><span class="lineno">  714</span>&#160;  <span class="comment">// NOTE: Seem to get linker errors when moving this to the cpp</span></div>
<div class="line"><a name="l00722"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a60ac433549405b9bfa8ec16ba7abbe6d">  722</a></span>&#160;<span class="comment"></span>  <span class="keyword">friend</span> std::ostream&amp; <a class="code" href="classhelib_1_1_ptxt.html#a60ac433549405b9bfa8ec16ba7abbe6d">operator&lt;&lt;</a>(std::ostream&amp; os, <span class="keyword">const</span> <a class="code" href="classhelib_1_1_ptxt.html">Ptxt&lt;Scheme&gt;</a>&amp; ptxt)</div>
<div class="line"><a name="l00723"></a><span class="lineno">  723</span>&#160;  {</div>
<div class="line"><a name="l00724"></a><span class="lineno">  724</span>&#160;    assertTrue&lt;RuntimeError&gt;(ptxt.isValid(),</div>
<div class="line"><a name="l00725"></a><span class="lineno">  725</span>&#160;                             <span class="stringliteral">&quot;Cannot operate on invalid &quot;</span></div>
<div class="line"><a name="l00726"></a><span class="lineno">  726</span>&#160;                             <span class="stringliteral">&quot;(default constructed) Ptxt&quot;</span>);</div>
<div class="line"><a name="l00727"></a><span class="lineno">  727</span>&#160;    <span class="comment">// Use destructor to make sure stream precision is reset</span></div>
<div class="line"><a name="l00728"></a><span class="lineno">  728</span>&#160;    <span class="keyword">struct </span>stream_modifier</div>
<div class="line"><a name="l00729"></a><span class="lineno">  729</span>&#160;    {</div>
<div class="line"><a name="l00730"></a><span class="lineno">  730</span>&#160;      <span class="keyword">explicit</span> stream_modifier(std::ostream&amp; os) : os(os), ss(os.precision())</div>
<div class="line"><a name="l00731"></a><span class="lineno">  731</span>&#160;      {</div>
<div class="line"><a name="l00732"></a><span class="lineno">  732</span>&#160;        os &lt;&lt; std::setprecision(std::numeric_limits&lt;double&gt;::digits10);</div>
<div class="line"><a name="l00733"></a><span class="lineno">  733</span>&#160;      };</div>
<div class="line"><a name="l00734"></a><span class="lineno">  734</span>&#160;      ~stream_modifier() { os &lt;&lt; std::setprecision(ss); };</div>
<div class="line"><a name="l00735"></a><span class="lineno">  735</span>&#160;      std::ostream&amp; os;</div>
<div class="line"><a name="l00736"></a><span class="lineno">  736</span>&#160;      std::streamsize ss;</div>
<div class="line"><a name="l00737"></a><span class="lineno">  737</span>&#160;    };</div>
<div class="line"><a name="l00738"></a><span class="lineno">  738</span>&#160; </div>
<div class="line"><a name="l00739"></a><span class="lineno">  739</span>&#160;    stream_modifier sm(os);</div>
<div class="line"><a name="l00740"></a><span class="lineno">  740</span>&#160; </div>
<div class="line"><a name="l00741"></a><span class="lineno">  741</span>&#160;    os &lt;&lt; <span class="stringliteral">&quot;[&quot;</span>;</div>
<div class="line"><a name="l00742"></a><span class="lineno">  742</span>&#160;    <span class="keywordflow">for</span> (std::size_t i = 0; i &lt; ptxt.slots.size(); ++i) {</div>
<div class="line"><a name="l00743"></a><span class="lineno">  743</span>&#160;      os &lt;&lt; ptxt.slots[i];</div>
<div class="line"><a name="l00744"></a><span class="lineno">  744</span>&#160;      <span class="keywordflow">if</span> (i != ptxt.slots.size() - 1) {</div>
<div class="line"><a name="l00745"></a><span class="lineno">  745</span>&#160;        os &lt;&lt; <span class="stringliteral">&quot; &quot;</span>;</div>
<div class="line"><a name="l00746"></a><span class="lineno">  746</span>&#160;      }</div>
<div class="line"><a name="l00747"></a><span class="lineno">  747</span>&#160;    }</div>
<div class="line"><a name="l00748"></a><span class="lineno">  748</span>&#160;    <span class="keywordflow">return</span> os &lt;&lt; <span class="stringliteral">&quot;]&quot;</span>;</div>
<div class="line"><a name="l00749"></a><span class="lineno">  749</span>&#160;  }</div>
<div class="line"><a name="l00750"></a><span class="lineno">  750</span>&#160; </div>
<div class="line"><a name="l00757"></a><span class="lineno"><a class="line" href="classhelib_1_1_ptxt.html#a5421f8a8d23924a82163464867c353ce">  757</a></span>&#160;  <span class="keyword">static</span> <a class="code" href="classhelib_1_1_ptxt.html#a208b1ed55bce96f126191cb7a39b92e7">SlotType</a> <a class="code" href="classhelib_1_1_ptxt.html#a5421f8a8d23924a82163464867c353ce">convertToSlot</a>(<span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a>&amp; context, <span class="keywordtype">long</span> slot);</div>
<div class="line"><a name="l00758"></a><span class="lineno">  758</span>&#160; </div>
<div class="line"><a name="l00759"></a><span class="lineno">  759</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00760"></a><span class="lineno">  760</span>&#160;  <span class="keyword">const</span> <a class="code" href="classhelib_1_1_context.html">Context</a>* context;</div>
<div class="line"><a name="l00761"></a><span class="lineno">  761</span>&#160; </div>
<div class="line"><a name="l00764"></a><span class="lineno">  764</span>&#160;  std::vector&lt;SlotType&gt; slots;</div>
<div class="line"><a name="l00765"></a><span class="lineno">  765</span>&#160; </div>
<div class="line"><a name="l00775"></a><span class="lineno">  775</span>&#160;  <span class="keywordtype">long</span> coordToIndex(<span class="keyword">const</span> std::vector&lt;long&gt;&amp; coords);</div>
<div class="line"><a name="l00776"></a><span class="lineno">  776</span>&#160; </div>
<div class="line"><a name="l00786"></a><span class="lineno">  786</span>&#160;  std::vector&lt;long&gt; indexToCoord(<span class="keywordtype">long</span> index);</div>
<div class="line"><a name="l00787"></a><span class="lineno">  787</span>&#160; </div>
<div class="line"><a name="l00794"></a><span class="lineno">  794</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> type&gt;</div>
<div class="line"><a name="l00795"></a><span class="lineno">  795</span>&#160;  <span class="keyword">typename</span> type::RX slotsToRX() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00796"></a><span class="lineno">  796</span>&#160; </div>
<div class="line"><a name="l00807"></a><span class="lineno">  807</span>&#160;  <span class="keywordtype">void</span> assertSlotsCompatible(<span class="keyword">const</span> std::vector&lt;SlotType&gt;&amp; slots) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00808"></a><span class="lineno">  808</span>&#160; </div>
<div class="line"><a name="l00818"></a><span class="lineno">  818</span>&#160;  <span class="keyword">template</span> &lt;<span class="keyword">typename</span> type&gt;</div>
<div class="line"><a name="l00819"></a><span class="lineno">  819</span>&#160;  NTL::ZZX automorph_internal(<span class="keywordtype">long</span> k);</div>
<div class="line"><a name="l00820"></a><span class="lineno">  820</span>&#160;};</div>
<div class="line"><a name="l00821"></a><span class="lineno">  821</span>&#160;} <span class="comment">// namespace helib</span></div>
<div class="line"><a name="l00822"></a><span class="lineno">  822</span>&#160; </div>
<div class="line"><a name="l00823"></a><span class="lineno">  823</span>&#160;<span class="preprocessor">#endif // HELIB_PTXT_H</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclasshelib_1_1_ptxt_html"><div class="ttname"><a href="classhelib_1_1_ptxt.html">helib::Ptxt</a></div><div class="ttdoc">An object that mimics the functionality of the Ctxt object, and acts as a convenient entry point for ...</div><div class="ttdef"><b>Definition:</b> Ctxt.h:66</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a56bda6e45a7f413914cea175a4edcca6"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a56bda6e45a7f413914cea175a4edcca6">helib::Ptxt::operator*=</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; operator*=(const Scalar &amp;scalar)</div><div class="ttdoc">Times equals operator with a scalar.</div><div class="ttdef"><b>Definition:</b> Ptxt.h:413</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a39d6d5db3059090134312fecefc468da"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a39d6d5db3059090134312fecefc468da">helib::Ptxt::lsize</a></div><div class="ttdeci">long lsize() const</div><div class="ttdoc">Returns the size (number of slots) of a Ptxt as long.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:97</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_ad0d1e152b220e9219e015d8601972efe"><div class="ttname"><a href="classhelib_1_1_ptxt.html#ad0d1e152b220e9219e015d8601972efe">helib::Ptxt::operator*</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; operator*(const Ptxt&lt; Scheme &gt; &amp;rhs) const</div><div class="ttdoc">Infix multiplication operator.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:273</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_ae7933c3b8ff51f923a3bc95752a0fc2c"><div class="ttname"><a href="classhelib_1_1_ptxt.html#ae7933c3b8ff51f923a3bc95752a0fc2c">helib::Ptxt::rotate1D</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; rotate1D(long dim, long amount)</div><div class="ttdoc">Rotate slots right by specified amount along a specific dimension.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:537</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a0aea2308633c8fe6260b12a72278e83b"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a0aea2308633c8fe6260b12a72278e83b">helib::Ptxt::operator-=</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; operator-=(const SlotType &amp;scalar)</div><div class="ttdoc">Minus equals operator with a single SlotType.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_af7b37d52345b0cfab052227e43278f28"><div class="ttname"><a href="classhelib_1_1_ptxt.html#af7b37d52345b0cfab052227e43278f28">helib::Ptxt::Ptxt</a></div><div class="ttdeci">Ptxt(const Context &amp;context, const std::vector&lt; T &gt; &amp;data)</div><div class="ttdoc">Generic slot vector constructor.</div><div class="ttdef"><b>Definition:</b> Ptxt.h:221</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a2bb2dbd5b558778d17658182ee05d4a8"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a2bb2dbd5b558778d17658182ee05d4a8">helib::Ptxt::operator==</a></div><div class="ttdeci">bool operator==(const Ptxt&lt; Scheme &gt; &amp;other) const</div><div class="ttdoc">Equals operator between two Ptxt objects.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:260</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a2856a44b1a4ed056b2ab25136572dc16"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a2856a44b1a4ed056b2ab25136572dc16">helib::Ptxt::getPolyRepr</a></div><div class="ttdeci">NTL::ZZX getPolyRepr() const</div><div class="ttdoc">Converts the slot data in this to its single polynomial representation.</div></div>
<div class="ttc" id="astructhelib_1_1_b_g_v_html"><div class="ttname"><a href="structhelib_1_1_b_g_v.html">helib::BGV</a></div><div class="ttdoc">Type for BGV scheme, to be used as template parameter.</div><div class="ttdef"><b>Definition:</b> Ptxt.h:50</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a77c0d3dc8d65ad5c0abca52210878b9d"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a77c0d3dc8d65ad5c0abca52210878b9d">helib::Ptxt::mapTo01</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; mapTo01()</div><div class="ttdoc">Map all non-zero slots to 1, keeping zero slots as zero.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:803</div></div>
<div class="ttc" id="anamespacehelib_html_ae05ae4d1e5789165fa5fe70824e87077"><div class="ttname"><a href="namespacehelib.html#ae05ae4d1e5789165fa5fe70824e87077">helib::convertDataToSlotVector</a></div><div class="ttdeci">std::vector&lt; typename Scheme::SlotType &gt; convertDataToSlotVector(const std::vector&lt; From &gt; &amp;data, const Context &amp;context)</div><div class="ttdoc">Converts std::vector&lt;From&gt; to std::vector&lt;Scheme::SlotType&gt;.</div><div class="ttdef"><b>Definition:</b> Ptxt.h:69</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a47b64faee8b052ccccda7df6a5fa0a22"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a47b64faee8b052ccccda7df6a5fa0a22">helib::Ptxt::clear</a></div><div class="ttdeci">void clear()</div><div class="ttdoc">Sets all slots to 0.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:148</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a111b70a6cf4517c55c3f5337308903a4"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a111b70a6cf4517c55c3f5337308903a4">helib::Ptxt::at</a></div><div class="ttdeci">SlotType &amp; at(long i)</div><div class="ttdoc">at accessor operator.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:246</div></div>
<div class="ttc" id="astructhelib_1_1_c_k_k_s_html_a7c8b6e96117c89f9395b2f1ccdc1e0a0"><div class="ttname"><a href="structhelib_1_1_c_k_k_s.html#a7c8b6e96117c89f9395b2f1ccdc1e0a0">helib::CKKS::SlotType</a></div><div class="ttdeci">std::complex&lt; double &gt; SlotType</div><div class="ttdoc">Slot type used for CKKS plaintexts: std::complex&lt;double&gt;.</div><div class="ttdef"><b>Definition:</b> Ptxt.h:43</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a479e27b3f9a7550a750acf6613c33b8d"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a479e27b3f9a7550a750acf6613c33b8d">helib::Ptxt::runningSums</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; runningSums()</div><div class="ttdoc">Compute the running sum (each slot is the sum of the previous slots).</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:755</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_ac34ee5c8a8c3341cd97b57345aee7f84"><div class="ttname"><a href="classhelib_1_1_ptxt.html#ac34ee5c8a8c3341cd97b57345aee7f84">helib::Ptxt::Ptxt</a></div><div class="ttdeci">Ptxt(const Context &amp;context)</div><div class="ttdoc">Context only constructor, defaults all slots to 0.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a6089a4133bf1b54676a70ea49e89d20e"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a6089a4133bf1b54676a70ea49e89d20e">helib::Ptxt::decodeSetData</a></div><div class="ttdeci">void decodeSetData(const NTL::ZZX &amp;data)</div><div class="ttdoc">Set the Ptxt slots using values from decoding data to slot representation.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_acba1c7e7d92aa7a31b555046fa39f4b3"><div class="ttname"><a href="classhelib_1_1_ptxt.html#acba1c7e7d92aa7a31b555046fa39f4b3">helib::Ptxt::Ptxt</a></div><div class="ttdeci">Ptxt(const Context &amp;context, const std::vector&lt; SlotType &gt; &amp;data)</div><div class="ttdoc">Slot vector constructor.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a11f7e4e965acab1f6db834797ae165f2"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a11f7e4e965acab1f6db834797ae165f2">helib::Ptxt::operator&gt;&gt;</a></div><div class="ttdeci">friend std::istream &amp; operator&gt;&gt;(std::istream &amp;is, Ptxt&lt; Scheme &gt; &amp;ptxt)</div><div class="ttdoc">Input shift operator.</div><div class="ttdef"><b>Definition:</b> Ptxt.h:696</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a7f5ad875da05a1562e319f3943892c67"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a7f5ad875da05a1562e319f3943892c67">helib::Ptxt::replicateAll</a></div><div class="ttdeci">std::vector&lt; Ptxt&lt; Scheme &gt; &gt; replicateAll() const</div><div class="ttdoc">Generate a vector of plaintexts with each slot replicated in each plaintext.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:706</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a063d478ac57438d9434921967313f474"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a063d478ac57438d9434921967313f474">helib::Ptxt::Ptxt</a></div><div class="ttdeci">Ptxt(const Context &amp;context, const SlotType &amp;value)</div><div class="ttdoc">Single slot constructor, set all slots to value.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a1587b07072208696849f02a3b40892e8"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a1587b07072208696849f02a3b40892e8">helib::Ptxt::totalProduct</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; totalProduct()</div><div class="ttdoc">Compute the total product (each slot contains the total product of every slot).</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:790</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_ace682ff41a5f1833ae298aa8d33e05d5"><div class="ttname"><a href="classhelib_1_1_ptxt.html#ace682ff41a5f1833ae298aa8d33e05d5">helib::Ptxt::imag</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; imag() const</div><div class="ttdoc">Extract the imaginary part of a CKKS plaintext.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_ac4568bc2e02b7dc906568f2c7c7eaaa8"><div class="ttname"><a href="classhelib_1_1_ptxt.html#ac4568bc2e02b7dc906568f2c7c7eaaa8">helib::Ptxt::Ptxt</a></div><div class="ttdeci">Ptxt(Ptxt&lt; Scheme &gt; &amp;&amp;other) noexcept=default</div><div class="ttdoc">Default move constructor.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a208b1ed55bce96f126191cb7a39b92e7"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a208b1ed55bce96f126191cb7a39b92e7">helib::Ptxt::SlotType</a></div><div class="ttdeci">typename Scheme::SlotType SlotType</div><div class="ttdoc">Alias for type to be stored in the slots.</div><div class="ttdef"><b>Definition:</b> Ptxt.h:176</div></div>
<div class="ttc" id="astructhelib_1_1_c_k_k_s_html"><div class="ttname"><a href="structhelib_1_1_c_k_k_s.html">helib::CKKS</a></div><div class="ttdoc">Type for CKKS scheme, to be used as template parameter.</div><div class="ttdef"><b>Definition:</b> Ptxt.h:39</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a237db676327d7353bee8852cd3a9416c"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a237db676327d7353bee8852cd3a9416c">helib::Ptxt::operator[]</a></div><div class="ttdeci">SlotType &amp; operator[](long i)</div><div class="ttdoc">Square bracket accessor operator.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:228</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a73bfcf600de1d55cd66281428396a6ec"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a73bfcf600de1d55cd66281428396a6ec">helib::Ptxt::shift1D</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; shift1D(long dim, long amount)</div><div class="ttdoc">Shift slots right in one dimension of the hypercube structure with 0 fill.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:600</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_ad048de2d62d0e4c843ddb48b85c63314"><div class="ttname"><a href="classhelib_1_1_ptxt.html#ad048de2d62d0e4c843ddb48b85c63314">helib::Ptxt::incrementalProduct</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; incrementalProduct()</div><div class="ttdoc">Compute the incremental product (each slot is the product of the previous slots).</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:779</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_ab4c4b82672819e72a5eab6883cf54cae"><div class="ttname"><a href="classhelib_1_1_ptxt.html#ab4c4b82672819e72a5eab6883cf54cae">helib::Ptxt::operator+</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; operator+(const Ptxt&lt; Scheme &gt; &amp;rhs) const</div><div class="ttdoc">Infix addition operator.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:290</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a71edaa17612629ec56220ea022202016"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a71edaa17612629ec56220ea022202016">helib::Ptxt::~Ptxt</a></div><div class="ttdeci">~Ptxt()=default</div><div class="ttdoc">Default destructor.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a594ce012fe4bf3ac5d45dc95609c7e4d"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a594ce012fe4bf3ac5d45dc95609c7e4d">helib::Ptxt::square</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; square()</div><div class="ttdoc">Square operation on a Ptxt.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:478</div></div>
<div class="ttc" id="a_poly_mod_8h_html"><div class="ttname"><a href="_poly_mod_8h.html">PolyMod.h</a></div><div class="ttdoc">Underlying slot type structure of BGV ptxts.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_aa244b723b8202496b3916b8a16f6273c"><div class="ttname"><a href="classhelib_1_1_ptxt.html#aa244b723b8202496b3916b8a16f6273c">helib::Ptxt::negate</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; negate()</div><div class="ttdoc">Negate a Ptxt.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:414</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_af8c161f20f558486c92d71e65d8ec0e3"><div class="ttname"><a href="classhelib_1_1_ptxt.html#af8c161f20f558486c92d71e65d8ec0e3">helib::Ptxt::cube</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; cube()</div><div class="ttdoc">Cube operation on a Ptxt.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:486</div></div>
<div class="ttc" id="a_encrypted_array_8h_html"><div class="ttname"><a href="_encrypted_array_8h.html">EncryptedArray.h</a></div><div class="ttdoc">Data-movement operations on encrypted arrays of slots.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_adfe4b6cb41fcdabb88f2e6533c1829e2"><div class="ttname"><a href="classhelib_1_1_ptxt.html#adfe4b6cb41fcdabb88f2e6533c1829e2">helib::Ptxt::operator-</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; operator-(const Ptxt&lt; Scheme &gt; &amp;rhs) const</div><div class="ttdoc">Infix subtraction operator.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:307</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a5d33b4eb138d5c12a50343d25ea3a993"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a5d33b4eb138d5c12a50343d25ea3a993">helib::Ptxt::frobeniusAutomorph</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; frobeniusAutomorph(long j)</div><div class="ttdoc">Apply the frobenius automorphism a(X) -&gt; a(X^(p^j)) mod Phi_m(X).</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_af20f43e81e6e83711e6a2f877c5d976e"><div class="ttname"><a href="classhelib_1_1_ptxt.html#af20f43e81e6e83711e6a2f877c5d976e">helib::Ptxt::operator=</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; operator=(const Ptxt&lt; Scheme &gt; &amp;v)=default</div><div class="ttdoc">Copy assignment operator with other Ptxt.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a60ac433549405b9bfa8ec16ba7abbe6d"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a60ac433549405b9bfa8ec16ba7abbe6d">helib::Ptxt::operator&lt;&lt;</a></div><div class="ttdeci">friend std::ostream &amp; operator&lt;&lt;(std::ostream &amp;os, const Ptxt&lt; Scheme &gt; &amp;ptxt)</div><div class="ttdoc">Output shift operator.</div><div class="ttdef"><b>Definition:</b> Ptxt.h:722</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a8e771f1be21da0f50d6df0a2a541e568"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a8e771f1be21da0f50d6df0a2a541e568">helib::Ptxt::random</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; random()</div><div class="ttdoc">Populate slots with random data.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:176</div></div>
<div class="ttc" id="anamespacehelib_html_a391719dad458fcb9560406cb565f8cbe"><div class="ttname"><a href="namespacehelib.html#a391719dad458fcb9560406cb565f8cbe">helib::innerProduct</a></div><div class="ttdeci">void innerProduct(Ctxt &amp;result, const CtPtrs &amp;v1, const CtPtrs &amp;v2)</div><div class="ttdef"><b>Definition:</b> Ctxt.cpp:1994</div></div>
<div class="ttc" id="anamespacehelib_html"><div class="ttname"><a href="namespacehelib.html">helib</a></div><div class="ttdef"><b>Definition:</b> apiAttributes.h:21</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_af6f617ad696129bf2f1c97f082875417"><div class="ttname"><a href="classhelib_1_1_ptxt.html#af6f617ad696129bf2f1c97f082875417">helib::Ptxt::operator*=</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; operator*=(const SlotType &amp;scalar)</div><div class="ttdoc">Times equals operator with a single SlotType.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a5539f04b6f8741aa37f44700bb00ef63"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a5539f04b6f8741aa37f44700bb00ef63">helib::Ptxt::multiplyBy</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; multiplyBy(const Ptxt&lt; Scheme &gt; &amp;otherPtxt)</div><div class="ttdoc">Multiplication function between two Ptxt objects.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:425</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a5421f8a8d23924a82163464867c353ce"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a5421f8a8d23924a82163464867c353ce">helib::Ptxt::convertToSlot</a></div><div class="ttdeci">static SlotType convertToSlot(const Context &amp;context, long slot)</div><div class="ttdoc">Conversion function from long to SlotType.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_ab3f4f86d8be5982f163edda7b69e05a6"><div class="ttname"><a href="classhelib_1_1_ptxt.html#ab3f4f86d8be5982f163edda7b69e05a6">helib::Ptxt::operator-=</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; operator-=(const Ptxt&lt; Scheme &gt; &amp;otherPtxt)</div><div class="ttdoc">Minus equals operator with another Ptxt.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a19e06cbbfcb57ebafe71f650501f56cf"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a19e06cbbfcb57ebafe71f650501f56cf">helib::Ptxt::addConstantCKKS</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; addConstantCKKS(const Scalar &amp;scalar)</div><div class="ttdoc">Add a constant to a CKKS Ptxt.</div><div class="ttdef"><b>Definition:</b> Ptxt.h:513</div></div>
<div class="ttc" id="anamespacehelib_html_a0df3789de0744e7c90d5a5d6cf54a5ed"><div class="ttname"><a href="namespacehelib.html#a0df3789de0744e7c90d5a5d6cf54a5ed">helib::seekPastChar</a></div><div class="ttdeci">void seekPastChar(std::istream &amp;str, int cc)</div><div class="ttdoc">Advance the input stream beyond white spaces and a single instance of the char cc.</div><div class="ttdef"><b>Definition:</b> NumbTh.cpp:1046</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a1ac29a900263dbba14e9a48e651b9159"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a1ac29a900263dbba14e9a48e651b9159">helib::Ptxt::setData</a></div><div class="ttdeci">void setData(const std::vector&lt; SlotType &gt; &amp;data)</div><div class="ttdoc">Set the data.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a2e4cb8d393da906329f6a591d399a346"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a2e4cb8d393da906329f6a591d399a346">helib::Ptxt::operator=</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; operator=(Ptxt&lt; Scheme &gt; &amp;&amp;v) noexcept=default</div><div class="ttdoc">Move assignment operator with other Ptxt.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_ad669299fa7fed4a37bc8536a9d3dcf05"><div class="ttname"><a href="classhelib_1_1_ptxt.html#ad669299fa7fed4a37bc8536a9d3dcf05">helib::Ptxt::power</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; power(long e)</div><div class="ttdoc">Power operation to raise a Ptxt to an arbitrary non-negative power.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:494</div></div>
<div class="ttc" id="a_context_8h_html"><div class="ttname"><a href="_context_8h.html">Context.h</a></div><div class="ttdoc">Keeps the parameters of an instance of the cryptosystem.</div></div>
<div class="ttc" id="aclasshelib_1_1_context_html"><div class="ttname"><a href="classhelib_1_1_context.html">helib::Context</a></div><div class="ttdoc">Maintaining the parameters.</div><div class="ttdef"><b>Definition:</b> Context.h:58</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a8468a37b7d0aad635d6a9236d426be21"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a8468a37b7d0aad635d6a9236d426be21">helib::Ptxt::addConstant</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; addConstant(const Scalar &amp;scalar)</div><div class="ttdoc">Add a constant to a BGV Ptxt.</div><div class="ttdef"><b>Definition:</b> Ptxt.h:500</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a84591d6e8b595b82e67e5f5968638228"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a84591d6e8b595b82e67e5f5968638228">helib::Ptxt::setData</a></div><div class="ttdeci">void setData(const NTL::ZZX &amp;value)</div><div class="ttdoc">Set the Ptxt data replicating the input polynomial on all slots.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_ae1a0c1d39f2077bede420a150d459e1d"><div class="ttname"><a href="classhelib_1_1_ptxt.html#ae1a0c1d39f2077bede420a150d459e1d">helib::Ptxt::real</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; real() const</div><div class="ttdoc">Extract the real part of a CKKS plaintext.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_adc3c98383082db58d8980e4d4ad5aa49"><div class="ttname"><a href="classhelib_1_1_ptxt.html#adc3c98383082db58d8980e4d4ad5aa49">helib::Ptxt::isValid</a></div><div class="ttdeci">bool isValid() const</div><div class="ttdoc">Check if a Ptxt is valid.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:83</div></div>
<div class="ttc" id="aclasshelib_1_1_poly_mod_html"><div class="ttname"><a href="classhelib_1_1_poly_mod.html">helib::PolyMod</a></div><div class="ttdoc">An object that contains an NTL::ZZX polynomial along with a coefficient modulus p2r and a polynomial ...</div><div class="ttdef"><b>Definition:</b> PolyMod.h:47</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a9079d2c55de7a19af137da3d042c50d4"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a9079d2c55de7a19af137da3d042c50d4">helib::Ptxt::getSlotRepr</a></div><div class="ttdeci">const std::vector&lt; SlotType &gt; &amp; getSlotRepr() const</div><div class="ttdoc">Get the data held in the slots as a std::vector&lt;SlotType&gt;.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:184</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_ab38174daa0112a946ccbd93b599b3a4f"><div class="ttname"><a href="classhelib_1_1_ptxt.html#ab38174daa0112a946ccbd93b599b3a4f">helib::Ptxt::Ptxt</a></div><div class="ttdeci">Ptxt()</div><div class="ttdoc">Default constructor results in invalid Ptxt object which throws if used.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a892c7c40f3029f29b4ed0bbd633301d8"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a892c7c40f3029f29b4ed0bbd633301d8">helib::Ptxt::size</a></div><div class="ttdeci">size_t size() const</div><div class="ttdoc">Returns the size (number of slots) of a Ptxt.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:89</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_afa812aae90f9454920a1033fc0790dfd"><div class="ttname"><a href="classhelib_1_1_ptxt.html#afa812aae90f9454920a1033fc0790dfd">helib::Ptxt::shift</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; shift(long amount)</div><div class="ttdoc">Shifts slots right by specified amount with 0 fill (slot i goes to slot i+1 mod size).</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:580</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a9e87f1ffcfcd55fbfa04e0d8b68addb8"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a9e87f1ffcfcd55fbfa04e0d8b68addb8">helib::Ptxt::rotate</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; rotate(long amount)</div><div class="ttdoc">Rotate slots right by specified amount (slot i goes to slot i+1 mod size).</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:521</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_ab1db75c37d202538affad4865f6d60b0"><div class="ttname"><a href="classhelib_1_1_ptxt.html#ab1db75c37d202538affad4865f6d60b0">helib::Ptxt::operator+=</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; operator+=(const Scalar &amp;scalar)</div><div class="ttdoc">Plus equals operator with a scalar.</div><div class="ttdef"><b>Definition:</b> Ptxt.h:444</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a794648794e265a250ad9c23572b92b39"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a794648794e265a250ad9c23572b92b39">helib::Ptxt::automorph</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; automorph(long k)</div><div class="ttdoc">Apply the automorphism a(X) -&gt; a(X^k) mod Phi_m(X).</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_ac130b4ef05a3a3673b39f00ce31b2118"><div class="ttname"><a href="classhelib_1_1_ptxt.html#ac130b4ef05a3a3673b39f00ce31b2118">helib::Ptxt::operator-=</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; operator-=(const Scalar &amp;scalar)</div><div class="ttdoc">Minus equals operator with a scalar.</div><div class="ttdef"><b>Definition:</b> Ptxt.h:475</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_af5550960308d217de80a149432acb6aa"><div class="ttname"><a href="classhelib_1_1_ptxt.html#af5550960308d217de80a149432acb6aa">helib::Ptxt::Ptxt</a></div><div class="ttdeci">Ptxt(const Context &amp;context, const NTL::ZZX &amp;value)</div><div class="ttdoc">BGV plaintext polynomial constructor, set all slots to the value polynomial.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_af174eb635bae2953ad834594167972f4"><div class="ttname"><a href="classhelib_1_1_ptxt.html#af174eb635bae2953ad834594167972f4">helib::Ptxt::operator*=</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; operator*=(const Ptxt&lt; Scheme &gt; &amp;otherPtxt)</div><div class="ttdoc">Times equals operator with another Ptxt.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a34fe386648aff89c3bf201d0f1ea1e5b"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a34fe386648aff89c3bf201d0f1ea1e5b">helib::Ptxt::totalSums</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; totalSums()</div><div class="ttdoc">Compute the total sum (each slot contains the total sum of every slot).</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:766</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a33217b18b31a054fe1f1be6f3534c55a"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a33217b18b31a054fe1f1be6f3534c55a">helib::Ptxt::multiplyBy2</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; multiplyBy2(const Ptxt &amp;otherPtxt1, const Ptxt &amp;otherPtxt2)</div><div class="ttdoc">Multiplication function between three Ptxt objects.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:443</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a2f4c6a71ce9e9976e72a77f6c3175114"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a2f4c6a71ce9e9976e72a77f6c3175114">helib::Ptxt::Ptxt</a></div><div class="ttdeci">Ptxt(const Ptxt&lt; Scheme &gt; &amp;other)=default</div><div class="ttdoc">Default copy constructor.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a7e6d01d3c64034b36c49744714fc1721"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a7e6d01d3c64034b36c49744714fc1721">helib::Ptxt::operator!=</a></div><div class="ttdeci">bool operator!=(const Ptxt&lt; Scheme &gt; &amp;other) const</div><div class="ttdoc">Not equals operator between two Ptxt objects.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:267</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_ac5b145f55caed90aca67b22a5abda9b7"><div class="ttname"><a href="classhelib_1_1_ptxt.html#ac5b145f55caed90aca67b22a5abda9b7">helib::Ptxt::operator+=</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; operator+=(const SlotType &amp;scalar)</div><div class="ttdoc">Plus equals operator with a single SlotType.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a200fd09c6efe0887037783e261946e8b"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a200fd09c6efe0887037783e261946e8b">helib::Ptxt::complexConj</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; complexConj()</div><div class="ttdoc">Apply complex conjugate of complex numbers in slots of a CKKS Ptxt object.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_ad1459a4416bb38e0863e220e5cfe6ff9"><div class="ttname"><a href="classhelib_1_1_ptxt.html#ad1459a4416bb38e0863e220e5cfe6ff9">helib::Ptxt::replicate</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; replicate(long pos)</div><div class="ttdoc">Replicate single slot across all slots.</div><div class="ttdef"><b>Definition:</b> Ptxt.cpp:696</div></div>
<div class="ttc" id="aassertions_8h_html"><div class="ttname"><a href="assertions_8h.html">assertions.h</a></div><div class="ttdoc">Various assertion functions for use within HElib. These are meant as a replacement for C-style assert...</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a2962844c9a07023f7de74bf954d6cc1d"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a2962844c9a07023f7de74bf954d6cc1d">helib::Ptxt::operator+=</a></div><div class="ttdeci">Ptxt&lt; Scheme &gt; &amp; operator+=(const Ptxt&lt; Scheme &gt; &amp;otherPtxt)</div><div class="ttdoc">Plus equals operator with another Ptxt.</div></div>
<div class="ttc" id="aclasshelib_1_1_ptxt_html_a1ff66432c893d5af08e11151d532ab6c"><div class="ttname"><a href="classhelib_1_1_ptxt.html#a1ff66432c893d5af08e11151d532ab6c">helib::Ptxt::setData</a></div><div class="ttdeci">void setData(const SlotType &amp;value)</div><div class="ttdoc">Set the data replicating the input on all slots.</div></div>
<!-- HTML footer for doxygen 1.8.8-->
<!-- start footer part -->
</div>
</div>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
        <script type="text/javascript" src="doxy-boot.js"></script>
</html>
